
package com.scs.application.modules.base.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.scs.application.core.exceptions.BusinessException;
import com.scs.application.core.service.IBaseService;
import com.scs.application.modules.base.dto.MaterialApplicantAddBatchDto;
import com.scs.application.modules.base.entity.MaterialApplicant;
import com.scs.application.modules.base.request.MaterialApplicantQueryRequest;

import java.util.List;

/**
 * MaterialApplicant service 接口
 *
 */
public interface MaterialApplicantService extends IBaseService<MaterialApplicant> {

    List<MaterialApplicant> list(MaterialApplicantQueryRequest request);


    IPage<MaterialApplicant> page(MaterialApplicantQueryRequest request);

    /**
     * 供货申请审核
     *
     * @param request
     * @return
     */
    IPage<MaterialApplicant> pageAudit(MaterialApplicantQueryRequest request);

    /**
     * 获取当前供应商的关联医院
     *
     * @param entity
     * @return
     */
    boolean saveHospital(MaterialApplicant entity);

    /**
     * 提交供货申请 制单状态提交为待审核状态
     *
     * @param id
     */
    void submit(String id);

    /**
     * 供货申请审核通过 已提交状态 修改为 已审核状态
     *
     * @param id
     */
    void pass(String id);

    /**
     * 供货申请审核不通过 已提交状态 修改为 取消状态
     *
     * @param id
     * @param reason
     */
    void cancel(String id, String reason);

    /**
     * 医院-商品规格  是否已经关联
     *
     * @param hospitalId     医院ID
     * @param materialSpecId 商品规格ID
     * @throws BusinessException 如果关系存在，将抛出异常
     */
    void assertRelExist(String hospitalId, String materialSpecId) throws BusinessException;

    void saveBatchWithPass(List<MaterialApplicantAddBatchDto> applicantAddBatchDtoList);
}
